class Dog{
    constructor(name,breed){
        this.name=name;
        this.breed=breed;
    }
    // static
    static info(){
        console.log('static method');
    }
    // 对象内部的get set操作 形式是方法 本质是读写
    get description(){//读取属性
        return `${this.name} ${this.breed}`;
    }
    set nicknames(value){
        this.nick=value.trim();
    }
    get nicknames(){
        return this.nick.toUpperCase();
    }
}

Dog.info();

const sunny=new Dog('sunny','Golden');
console.log(sunny.description);
sunny.nicknames='water';
console.log(sunny.nicknames);